home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ColorPicker.h
-
- Contains: TColorPicker is a simple color picker utility class
- TColorPicker.h contains the TColorPicker class definitions.
-
- Written by: Kent Sandvik
-
- Copyright: Copyright © 1993-1999 by Apple Computer, Inc., All Rights Reserved.
-
- You may incorporate this Apple sample source code into your program(s) without
- restriction. This Apple sample source code has been provided "AS IS" and the
- responsibility for its operation is yours. You are not permitted to redistribute
- this Apple sample source code as "Apple sample source code" after having made
- changes. If you're going to re-distribute the source, we require that you make
- it clear in the source that the code was descended from Apple sample source
- code, but that you've made changes.
-
- Change History (most recent first):
- 8/18/1999 Karl Groethe Updated for Metrowerks Codewarror Pro 2.1
-
-
- */
-
-
- // Declare label for this header file
- #ifndef _COLORPICKER_
- #define _COLORPICKER_
-
- #ifndef _DTSCPLUSLIBRARY_
- #include "DTSCPlusLibrary.h"
- #endif
-
- // TOOLBOX HEADERS
- #ifndef __COLORPICKER__
- #include <ColorPicker.h>
- #endif
-
- #ifndef __QUICKDRAW__
- #include <Quickdraw.h>
- #endif
-
- // _________________________________________________________________________________________________________ //
- // TColorPicker Class Interface.
- class TColorPicker
- {
- public:
- // CONSTRUCTORS AND DESTRUCTORS
- TColorPicker(Boolean keepTrack = true);
- virtual~ TColorPicker();
-
- // MAIN INTERFACE
- virtual Boolean Select(Str255 string = "\p");// select an RGB value
- virtual void Reset(); // reset so the initial color is white
- virtual RGBColor GetSelectedColor() const; // return RGB value of earlier Select
- virtual CMYColor GetSelectedCMYColor(); // return CMY value of earlier Select
- virtual HSLColor GetSelectedHSLColor(); // return HSL value of earlier Select
- virtual HSVColor GetSelectedHSVColor(); // return HSV value of earlier Select
-
- // FIELDS
- protected:
- Boolean fKeepTrack; // enable if we want to keep track of earlier selected color
- RGBColor fInitialColor; // initially set RGBvalue (if fKeepTrack is true)
- RGBColor fSelectedColor; // keeps the latest selected value
- Point fDialogPoint; // dialog point for the color picker
- };
-
- #endif
-
- // _________________________________________________________________________________________________________ //
-
- /* Change History (most recent last):
- No Init. Date Comment
- 1 khs 1/3/93 New file
- 2 khs 1/5/93 Cleanup
- */
-